{temp('admin/head')}

</head>
<body class="page-body">
	
			
		{temp('admin/left')}

			{temp('admin/top')}
			<div class="row">
				<div class="col-sm-12">
					
					<div class="panel panel-default">
						<div class="panel-heading">
							<h3 class="panel-title">{$tit}</h3>
						</div>
						<div class="panel-body">							
							<div class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">账号</label>
									
									<div class="col-sm-10">
										<input type="text" class="form-control" id="zh" style="width:30%;">
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">密码</label>
									
									<div class="col-sm-10">
										<input type="password" class="form-control" id="pwd" style="width:30%;">
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">确认密码</label>
									
									<div class="col-sm-10">
										<input type="password" class="form-control" id="pwd1" style="width:30%;">
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">姓名</label>
									
									<div class="col-sm-10">
										<input type="text" class="form-control" id="name" style="width:30%;">
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">性别</label>
									
									<div class="col-sm-10">
										<div class="radio">
											<label>
												<input name="sex" checked="checked" type="radio" value="0">不告诉你
											</label>
										</div>
										<div class="radio">
											<label>
												<input name="sex" type="radio" value="1">男
											</label>
										</div>
										<div class="radio">
											<label>
												<input name="radio-4" type="radio" value="2">女
											</label>
										</div>
									</div>									
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="field-1">锁定(不能登录)</label>
									
									<div class="col-sm-10">
										<div class="radio">
											<label>
												<input name="sd" checked="checked" type="radio" value="1">是
											</label>
										</div>
										<div class="radio">
											<label>
												<input name="sd" type="radio" value="0">否
											</label>
										</div>
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label">组</label>
									
									<div class="col-sm-10" style="width:21%">
										<select class="form-control" id="zuid">
											{foreach($zu as $k => $v)}
											<option value="{$v['id']}">{$v['name']}</option>
											{/foreach}
										</select>
									</div>
								</div>
								
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<div class="col-sm-10">
										<button class="btn btn-info btn-single pull-right" onclick="tj()" type="button">提交</button>
									</div>
								</div>
							</div>							
						</div>
					</div>
					
				</div>
			</div>
		{temp('admin/foot')}
		
	<script type="text/javascript">
		function tj(){
			var zh = $("#zh").val();
			var pwd = $("#pwd").val();
			var pwd1 = $("#pwd1").val();
			if(pwd != pwd1){
				alert('两次密码不一致');return ;
			}
			var name = $("#name").val();
			var sd = $("input[name='sd']:checked").val();
			var sex = $("input[name='sex']:checked").val();
			var zu = $("#zuid").val();
			$.post('/admin/?act=xitong&met=admin_tj{$gnpd}',{zh:zh,pwd:pwd,pwd1:pwd1,name:name,sd:sd,sex:sex,zu:zu},function(data){
				if(data == 'cg'){
					alert('添加成功');
					location.href = '/admin/?act=xitong&met=guanli{$gnpd}';
				}else if(data == 'error'){
					alert('添加失败');
				}else if(data == '-1'){
					alert('账号不能为空');
				}else if(data == '-2'){
					alert('密码不能为空');
				}else if(data == '-3'){
					alert('确认密码不能为空');
				}else if(data == '-4'){
					alert('昵称不能为空');
				}else if(data == '-5'){
					alert('两次密码输入不一样');
				}else if(data == '-6'){
					alert('该账号已被注册');
				}
			});
		}
	</script>
	<!-- Bottom Scripts -->
	<script src="{$adstyle}/js/bootstrap.min.js"></script>
	<script src="{$adstyle}/js/TweenMax.min.js"></script>
	<script src="{$adstyle}/js/resizeable.js"></script>
	<script src="{$adstyle}/js/joinable.js"></script>
	<script src="{$adstyle}/js/xenon-api.js"></script>
	<script src="{$adstyle}/js/xenon-toggles.js"></script>

	<!-- Imported scripts on this page -->
	<script src="{$adstyle}/js/select2/select2.min.js"></script>

	<!-- JavaScripts initializations and stuff -->
	<script src="{$adstyle}/js/xenon-custom.js"></script>
</body>
</html>